<?php


namespace App\Services\Business\Models;

use App\Services\Business\Models\Base;
use App\Services\Member\Models\User;
use App\Services\Business\Models\Photo;



class Appraise extends Base
{


    protected $table = 'appraise';

    protected $fillable = [
        'user_id', 'star', 'appraiseable_id', 'shop_id','content', 'appraiseable_type', 'is_recommend', 'is_appraised', 'appraised_time', 'created_at','updated_at',
    ];


    public function photos()
    {
        return $this->hasMany(Photo::class, 'appraise_id');

    }

    public function user()
    {
        return $this->belongsTo(User::class, 'user_id');
    }

    public function appraiseable()
    {
        return $this->morphTo();
    }

}
